package com.saishi.servlet;

import com.saishi.entity.User;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet(value = "/UidSer")
public class UidServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        HttpSession session=request.getSession();
        List<User> uit =(List<User>) session.getAttribute("userinfo");
        System.out.println(uit);
        for (User uu:uit){
             request.setAttribute("utr",uu.getUid());
             request.getRequestDispatcher("/cs.jsp").forward(request,response);
        }
    }
}
